package com.ftg.learn.bus.controller;


import com.ftg.learn.bus.entity.Role;
import com.ftg.learn.bus.service.IRoleService;
import com.ftg.learn.util.ResEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 角色表 前端控制器
 * </p>
 *
 * @author lalala
 * @since 2022-03-07
 */
@RestController
@RequestMapping("/bus/role")
@Api(tags = "角色管理功能列表")
public class RoleController extends CrudpController<Role, IRoleService> {


    @PutMapping("/updateById")
    @ApiOperation(value = "修改功能")
    @Override
    public ResEntity updateById(@RequestBody Role e){
        return service.updateById(e)?resEntity.OK():resEntity.Failure("操作失败，请重试!");
    }

}
